package com.r2coding.system.controller;

import com.r2coding.common.util.Result;
import com.r2coding.system.service.IndexService;
import com.r2coding.system.vo.resp.DataCountRespVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author:98k灬
 * @since:2022/06/04 12:03
 **/
@RestController
@RequestMapping("/index")
public class IndexController {
    @Autowired
    IndexService indexService;

    /**
     * 网站文章数、歌曲数、用户量、留言数
     *
     * @return 统一响应体
     */
    @GetMapping("/getDataCount")
    public Result getDataCount() {
        DataCountRespVo vo = indexService.getDataCount();
        return Result.ok(vo);
    }
}
